package redis

import (
	"context"
	"fmt"
)

func AddCart(userId, goodsId, num int, title, cover string, price float64) {
	key := fmt.Sprintf("cart:user_id_%d:goods_id_%d", userId, goodsId)
	Rdb.HMSet(context.Background(), key, map[string]interface{}{
		"goodsTitle": title,
		"goodsCover": cover,
		"goodsPrice": price,
		"goodsNum":   num,
		"checked":    1,
	})
}
